<?php structure_openBlock("table appl",apptitle($appname),""); ?>

<p>

<? if (admin_isadmin()){ ?>

<script type="text/javascript" src="js/tabs/tabpane.js"></script>
<link type="text/css" rel="StyleSheet" href="js/tabs/tabpane.css" />

<div class="tab-pane" id="tab-pane-1">

   <div class="tab-page">
      <h2 class="tab">THEME</h2>

<?


if (admin_isadmin()){

    // carica libemoticons e libBBcode se sono presenti
    loadlib("libBBcode");
    loadlib("libEmoticons");


 // $file=$_GET['file'];
    $file="/themes/".theme()."/theme.css";
    $op=$_GET['op'];
    $data=stripslashes($_POST['myfile']);


    if ($op=="save"){
	$hf=fopen($file,"w");
	fwrite($hf,$data);
	fclose($hf);
	echo "file $file salvato:<br/> $data   <hr/>";
    }
}
?>

    File:<b>[</b><?=$file?><b>]</b>
    <hr />

<form action="index.php?appname=<?=$appname?>&op=save&file=<?=$file?>" method="post">
<?php if (file_exists("extras/codepress/codepress.php")){ ?>
    <input type='hidden' name='myfile' value=''>
    <iframe id="codepress" name="codepress" src="extras/codepress/codepress.php?action=edit&file=<?=$file;?>&language=css" width="100%" height="400"></iframe>
    <p align='right'><input type="submit" name="save" value="save code" onClick="myfile.value = CodePress.getCode();"></p>
<?php }else{ ?>
    <textarea name="myfile" width="100%" height="400" style="width: 100%; height:400;" ><?=join(file($file));?></textarea>
    <p align='right'><input type="submit" name="save" value="save code"></p>
<?php }?>
</form>



   </div>

   <div class="tab-page">
      <h2 class="tab">STYLE</h2>

<?

if (admin_isadmin()){

    // carica libemoticons e libBBcode se sono presenti
    loadlib("libBBcode");
    loadlib("libEmoticons");


 // $file=$_GET['file'];
    $file="/themes/".theme()."/style.css";
    $op=$_GET['op'];
    $data=stripslashes($_POST['myfile']);


    if ($op=="save"){
	$hf=fopen($file,"w");
	fwrite($hf,$data);
	fclose($hf);
	echo "file $file salvato:<br/> $data   <hr/>";
    }
}
?>

    File:<b>[</b><?=$file?><b>]</b>
    <hr />

<form action="index.php?appname=<?=$appname?>&op=save&file=<?=$file?>" method="post">
<?php if (file_exists("extras/codepress/codepress.php")){ ?>
    <input type='hidden' name='myfile' value=''>
    <iframe id="codepress" name="codepress" src="extras/codepress/codepress.php?action=edit&file=<?=$file;?>&language=css" width="100%" height="400"></iframe>
    <p align='right'><input type="submit" name="save" value="save code" onClick="myfile.value = CodePress.getCode();"></p>
<?php }else{ ?>
    <textarea name="myfile" width="100%" height="400" style="width: 100%; height:400;" ><?=join(file($file));?></textarea>
    <p align='right'><input type="submit" name="save" value="save code"></p>
<?php }?>
</form>





   </div>

   <div class="tab-page">
      <h2 class="tab">STRUCTURE</h2>

<?

if (admin_isadmin()){

    // carica libemoticons e libBBcode se sono presenti
    loadlib("libBBcode");
    loadlib("libEmoticons");


 // $file=$_GET['file'];
    $file="/themes/".theme()."/structure.css";
    $op=$_GET['op'];
    $data=stripslashes($_POST['myfile']);


    if ($op=="save"){
	$hf=fopen($file,"w");
	fwrite($hf,$data);
	fclose($hf);
	echo "file $file salvato:<br/> $data   <hr/>";
    }
}
?>

    File:<b>[</b><?=$file?><b>]</b>
    <hr />

<form action="index.php?appname=<?=$appname?>&op=save&file=<?=$file?>" method="post">
<?php if (file_exists("extras/codepress/codepress.php")){ ?>
    <input type='hidden' name='myfile' value=''>
    <iframe id="codepress" name="codepress" src="extras/codepress/codepress.php?action=edit&file=<?=$file;?>&language=css" width="100%" height="400"></iframe>
    <p align='right'><input type="submit" name="save" value="save code" onClick="myfile.value = CodePress.getCode();"></p>
<?php }else{ ?>
    <textarea name="myfile" width="100%" height="400" style="width: 100%; height:400;" ><?=join(file($file));?></textarea>
    <p align='right'><input type="submit" name="save" value="save code"></p>
<?php }?>
</form>





   </div>


</div>

<? } ?>

</p>
<?php structure_closeBlock(); ?>
